package org.marketlive.system.encryption;

/**
 * Interface for encryption methods.
 */

/*
(C) Copyright MarketLive. 2006. All rights reserved.
MarketLive is a trademark of MarketLive, Inc.
Warning: This computer program is protected by copyright law and international treaties.
Unauthorized reproduction or distribution of this program, or any portion of it, may result
in severe civil and criminal penalties, and will be prosecuted to the maximum extent
possible under the law.
*/

public interface IEncryptor {

    /**
     * Init method to setup encryption.
     */
    void init();

    /**
     * Encrypts a string using security provider specific encryption scheme and return the encrypted string.
     * @param unencryptedString the string to encrypt.
     * @return  returns an encrypted string.
     * @throws EncryptionException
     */
    String encrypt(String unencryptedString) throws EncryptionException;
    
    /**
     * Encrypt the plain text input string using security provider specific encryption and return the encrypted string.
     * @param keyCode the keyCode to lookup the private key from the KeyStore table.
     * @param unencryptedString the unencrypted string to encrypt.
     * @return returns an encrytped string.
     * @throws EncryptionException
     */
    String encrypt(String keyCode, String unencryptedString) throws EncryptionException;
}
